package com.ruoyi.web.controller.material;

import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.system.domain.material.MaterialAnalysis;
import com.ruoyi.system.service.IMaterialAnalysisService;
import io.swagger.annotations.Api;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author GE-LV5
 * @create 2023/3/6 14:41
 */
@Api(tags = "物料解析")
@RequiredArgsConstructor(onConstructor_ = @Autowired)
@RestController
@RequestMapping("/material/analysis")
public class MaterialAnalysisController extends BaseController {

    @Autowired
    IMaterialAnalysisService iMaterialAnalysisService;
      /**
     * 物料解析
     */
    @Log(title = "物料解析" , businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody MaterialAnalysis baseTeam) {
        return toAjax(iMaterialAnalysisService.updateById(baseTeam) ? 1 : 0);
    }

}
